A rotary electric machine is used as a power source of a device. Some rotary electric machines are controlled on the basis of the position of a rotor. Some of the rotary electric machines as described above include a sensor that detects the position of a rotor, and a magnet for the detection as disclosed in Patent Literatures 1 and 2.